public class Test {
    public static void main(String[] args) {
        CPU cpu = new CPU();
        HardDisk HD = new HardDisk(200,"硬盘");
        cpu.setSpeed(2200);
        HD.setAmount(200);
        PC pc = new PC();
        pc.setCPU(cpu);
        pc.setHardDisk(HD);
        pc.show();
        System.out.println(pc.equals(cpu));
        System.out.println(cpu.equals(HD));
        System.out.println(HD.equals(pc));
        System.out.println(pc.toString());
        System.out.println(cpu.toString());
        System.out.println(HD.toString());
    }
}
